package acm.蓝桥杯二分前缀;

import java.util.Scanner;

public class 指数快速幂 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(pow(a,b));
    }
    public static long pow(long n, long k) {
        long res = 1;
        long temp = n;
        while (k > 0) {
            if (k % 2 != 0) {
                res *= temp;
            }
            temp *= temp;
            k /= 2;
        }
        return res;
    }
}
